package com.springboot.cloud.demos.feign.rest;

import com.springboot.cloud.common.core.entity.vo.Result;
import com.springboot.cloud.demos.feign.service.OrderService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController extends BaseController {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private OrderService orderService;

    @ApiOperation(value = "微信支付商品结果回调地址")
    @PostMapping("/open/wxpay/notify")
    public Result payGoodsNotify(@RequestBody String notifyData) {
        logger.debug("Received weixin pay notify information of goods, notify data is: {}", notifyData);
        System.out.println("notifyData:"+notifyData);
//        return orderService.wxpayNotify(notifyData);
        return Result.fail();
    }

}
